package com.huashi.dealer.commonEntity;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import io.swagger.v3.oas.annotations.media.Schema;
import lombok.Data;
import lombok.EqualsAndHashCode;

import java.math.BigDecimal;

/**
 * 购物车优惠活动关联模型类
 * 对应数据库表：yoshop_cart_discount
 * 用于关联购物车商品与优惠活动信息
 * 
 * @author 谭陈强
 * @since 2025-01-27
 */
@Data
@EqualsAndHashCode(callSuper = true)
@TableName("yoshop_cart_discount")
@Schema(description = "购物车优惠活动关联实体")
public class CartDiscount extends BaseModel {

    private static final long serialVersionUID = 1L;

    /**
     * 主键ID
     */
    @TableId(value = "id", type = IdType.AUTO)
    @Schema(description = "主键ID")
    private Long id;

    /**
     * 购物车ID
     */
    @TableField("cart_id")
    @Schema(description = "购物车ID")
    private Long cartId;

    /**
     * 优惠活动ID
     */
    @TableField("discount_id")
    @Schema(description = "优惠活动ID")
    private Long discountId;

    /**
     * 优惠类型：10满减，20折扣，30优惠券
     */
    @TableField("discount_type")
    @Schema(description = "优惠类型：10满减，20折扣，30优惠券")
    private Integer discountType;

    /**
     * 优惠活动名称
     */
    @TableField("discount_name")
    @Schema(description = "优惠活动名称")
    private String discountName;

    /**
     * 优惠活动描述
     */
    @TableField("discount_desc")
    @Schema(description = "优惠活动描述")
    private String discountDesc;

    /**
     * 优惠金额
     */
    @TableField("discount_amount")
    @Schema(description = "优惠金额")
    private BigDecimal discountAmount;

    /**
     * 折扣率
     */
    @TableField("discount_rate")
    @Schema(description = "折扣率")
    private BigDecimal discountRate;

    /**
     * 最低消费金额
     */
    @TableField("min_amount")
    @Schema(description = "最低消费金额")
    private BigDecimal minAmount;

    /**
     * 最大优惠金额
     */
    @TableField("max_discount")
    @Schema(description = "最大优惠金额")
    private BigDecimal maxDiscount;

    /**
     * 是否生效：0否，1是
     */
    @TableField("is_active")
    @Schema(description = "是否生效：0否，1是")
    private Integer isActive;

    /**
     * 创建时间
     */
    @TableField("create_time")
    @Schema(description = "创建时间")
    private Long createTime;

    /**
     * 更新时间
     */
    @TableField("update_time")
    @Schema(description = "更新时间")
    private Long updateTime;
}
